﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SnmpForm.ApIpPool
{
    class ApIpPool
    {
        //使用单件模式
        static ApIpPool _instance = null;
        public static ApIpPool Instance
        {
            get
            {
                if (_instance == null)
                {
                    _instance = new ApIpPool();
                }
                return _instance;
            }
        }

        Dictionary<int, string> mapAp = new Dictionary<int, string>();
        public string GetIp(int nApId)
        {
            string strIp = null;
            mapAp.TryGetValue(nApId, out strIp);
            return strIp;
        }
        public void Update(int nApId, string strIp)
        {
            mapAp[nApId] = strIp;
        }
    }
}
